<?php
//print_r($news);
//die;
$nav = selectAll('pro_cate','pid=0');
$cate = empty($_GET['cate'])?1:$_GET['cate'];
//$cate_id = $_GET['cate'];
$pro_cate = selectOne('pro_cate',"Id=$cate");
$banner = selectone('banner',"name='pro_banner'");
$cate_name = $pro_cate['name'];
//selectAll($table,$where=1,$field='*',$order = 'order by Id desc',$limit='')
$count = selectAll('product',"cate='$cate_name'",'count(*)')[0]['count(*)'];
//print_r($count);
//die;
$totolpage = ceil($count/6);
$page = empty($_GET['page'])?1:$_GET['page'];
$pages = ($page-1)*3;
$limit = " limit $pages,6";
//selectLimit($table,$field='*',$where=1,$limit='')

//print_r($cate_name);die;
//echo $cate_id;die;
$product = selectLimit('product','*',"cate='$cate_name' order by time desc",$limit);
if(!empty($_GET['search']))
{
	$proname = $_GET['search'];
//	print_r($_GET['search']);
//die;
	$product = selectLimit('product','*',"name='$proname' order by time desc",$limit);

}
//$product = selectAll('product',"cate='LED透明屏'",'*','order by time desc','limit 0,6');
include('app/index/product/html/product.html');
?>